# -*- coding: utf-8 -*-
"""
Created on Fri Nov 18 11:52:07 2022

@author: YSL
"""

words=str(input("请输入一段小写字母串："))
a=len(words)
text="ballon"
text_len=len(text)
text_num=[0]*text_len
number=0
for i in range(a):
    for j in range(text_len):
        if words[i]==text[j]:
            text_num[j]+=1
number=min(text_num)
print("最多可以输出 %d 次" % number)